package com.sentiment.database.bean;

import java.util.Date;
import java.util.Map;

import org.bson.Document;import org.bson.types.ObjectId;

public class StatisticsInfo {
	@Override
	public String toString() {
		return "StatisticsInfo [_id=" + _id + ", keyword_id=" + keyword_id + ", mediaRatio=" + mediaRatio
				+ ", releaseTimeRatio=" + releaseTimeRatio + ", reprintRatio=" + reprintRatio + "]";
	}


	public static final String dbName = "SentimentDB";
	public static final String collection = "StatisticsInfo";
	
	private ObjectId _id;
	private String keyword_id;
	private Map<String,Double> mediaRatio;
	private Map<String,Date> releaseTimeRatio;
	private Map<String,Integer> reprintRatio;

	public StatisticsInfo(Document doc){
		super();
		_id = doc.getObjectId("_id");
//		keyword_id = doc.getString("keyword_id");
		mediaRatio = (Map<String,Double>)doc.get("mediaRatio");
		releaseTimeRatio = (Map<String,Date>)doc.get("releaseTimeRatio");
		reprintRatio = (Map<String,Integer>)doc.get("reprintRatio");
		
	}

	
	public StatisticsInfo(Map<String, Double> mediaRatio, Map<String, Date> releaseTimeRatio,
			Map<String, Integer> reprintRatio) {
		super();
//		this.keyword_id = keyword_id;
		this.mediaRatio = mediaRatio;
		this.releaseTimeRatio = releaseTimeRatio;
		this.reprintRatio = reprintRatio;
	}


	public Document toDocument(){
		return new Document("mediaRatio", mediaRatio).append("releaseTimeRatio", releaseTimeRatio).append("reprintRatio", reprintRatio)
				.append("keyword_id", keyword_id);	
	}


	public String get_id() {
		return _id.toString();
	}


	public void set_id(String _id) {
		this._id = new ObjectId(_id);
	}


	public String getKeyword_id() {
		return keyword_id;
	}


	public void setKeyword_id(String keyword_id) {
		this.keyword_id = keyword_id;
	}


	public Map<String, Double> getMediaRatio() {
		return mediaRatio;
	}


	public void setMediaRatio(Map<String, Double> mediaRatio) {
		this.mediaRatio = mediaRatio;
	}


	public Map<String, Date> getReleaseTimeRatio() {
		return releaseTimeRatio;
	}


	public void setReleaseTimeRatio(Map<String, Date> releaseTimeRatio) {
		this.releaseTimeRatio = releaseTimeRatio;
	}


	public Map<String, Integer> getReprintRatio() {
		return reprintRatio;
	}


	public void setReprintRatio(Map<String, Integer> reprintRatio) {
		this.reprintRatio = reprintRatio;
	}
	
	
	
}

